﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="MusicSliderStyle" TargetType="{x:Type Slider}">
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
        <Setter Property="Background" Value="{StaticResource HorizontalGrooveBrush}"/>
        <Setter Property="IsMoveToPointEnabled" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Slider}">
                    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="Transparent" SnapsToDevicePixels="True">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Border x:Name="TrackBackground" Grid.Row="1" Margin="9,0" Height="3" Background="{StaticResource GrooveBackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                            <Track x:Name="PART_Track" Grid.Row="1">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Command="Slider.DecreaseLarge">
                                        <RepeatButton.Style>
                                            <Style TargetType="{x:Type RepeatButton}">
                                                <Setter Property="OverridesDefaultStyle" Value="True"/>
                                                <Setter Property="Background" Value="Transparent"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                            <Border x:Name="Border" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"/>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </RepeatButton.Style>
                                    </RepeatButton>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Command="Slider.IncreaseLarge">
                                        <RepeatButton.Style>
                                            <Style TargetType="{x:Type RepeatButton}">
                                                <Setter Property="OverridesDefaultStyle" Value="True"/>
                                                <Setter Property="Background" Value="Transparent"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                            <Border x:Name="Border" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"/>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </RepeatButton.Style>
                                    </RepeatButton>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb"
                                           OverridesDefaultStyle="True"
                                           Focusable="False"
                                           Width="21" Height="21"
                                           VerticalAlignment="Center">
                                        <Thumb.Template>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Grid>
                                                    <Border x:Name="GlowBorder" BorderThickness="3" BorderBrush="{StaticResource MusicSliderKnobPassiveBorderGlowBrush}" CornerRadius="11">
                                                        <Ellipse x:Name="Ellipse" Fill="{StaticResource MusicSliderButtonNormalBackgroundBrush}" StrokeThickness="1" Stroke="{StaticResource SliderThumbStrokeBrush}"/>
                                                    </Border>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource MusicSliderButtonMouseOverBackgroundBrush}"/>
                                                        <Setter TargetName="GlowBorder" Property="BorderBrush" Value="{StaticResource MusicSliderKnobActiveBorderGlowBrush}"/>
                                                    </Trigger>
                                                    <Trigger Property="IsDragging" Value="True">
                                                        <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource MusicSliderButtonPressedBackgroundBrush}"/>
                                                        <Setter TargetName="GlowBorder" Property="BorderBrush" Value="{StaticResource MusicSliderKnobActiveBorderGlowBrush}"/>
                                                    </Trigger>
                                                    <Trigger Property="IsEnabled" Value="False">
                                                        <Setter TargetName="Ellipse" Property="Fill" Value="Transparent"/>
                                                        <Setter TargetName="Ellipse" Property="Stroke" Value="Transparent"/>
                                                        <Setter TargetName="GlowBorder" Property="BorderBrush" Value="Transparent"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Thumb.Template>
                                    </Thumb>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>